<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="common.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>资源模块列表</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  
  <body>

<%@ include file="include.jsp" %>

<center><h3>模块列表</h3><br/></center>

	<permission:find permission="0" userid="${param.userid}" moduleid="${param.moduleid}">
		<a href="module-edit.action" style="float: right">添加模块</a>
	</permission:find>
	<br/><br/>
	
    <!-- 列表数据栏 -->
    <table width="100%" border="0" cellPadding="0" cellSpacing="1" bgcolor="#6386d6">
    <tr bgcolor="#EFF3F7" class="TableBody1">
		<td width="10%" height="37" align="center"><b>序号</b></td>
		<td width="20%" height="37" align="center"><B>模块名称</B></td>
		<td width="30%" height="37" align="center"><B>模块入口</B></td>
		<td width="40%" height="37" align="center"><B>操作</B></td>
    </tr>
    <c:if test="${!empty pm.resultList}">
		<c:forEach items="${pm.resultList}" var="info">
	    	<tr bgcolor="#EFF3F7" onmouseover="this.bgColor = '#DEE7FF';" onmouseout="this.bgColor='#EFF3F7';">
		    	<td align="center" vAlign="center">${info.id }</td>
				<td align="center" vAlign="center"><a href="module-find.action?module.id=${info.id}">${info.name }</a></td>
				<td align="center" vAlign="center">${info.url }</td>
        		<td align="center" vAlign="center">
        		
        			<permission:find permission="2" userid="${param.userid}" moduleid="${param.moduleid}">
						<a href="module-find.action?module.id=${info.id}">编辑</a>
					</permission:find>
					<permission:find permission="3" userid="${param.userid}" moduleid="${param.moduleid}">
						<a href="module-delete.action?module.id=${info.id}" onclick="return confirm('确定删除吗？');">删除</a>
					</permission:find>
        			
        		</td>
        	</tr>
        </c:forEach>
	</c:if>
	<c:if test="${empty pm.resultList}">
		<tr>
			<td>
	    		没有找到相应的记录
			</td>
		</tr>
	</c:if>
	</table>
	<TABLE width="100%" border=0 align=center cellPadding=0 cellSpacing=0 borderColor=#ffffff style="FONT-SIZE: 10pt">
        <TBODY>
          <TR>
            <TD height=28 align=right vAlign=center noWrap background=images/list_middle.jpg>&nbsp;&nbsp;
            <!-- 可以在这里插入分页导航条 -->
            <pg:pager url="module-list.action" maxPageItems="2" maxIndexPages="10" items="${pm.recordSum }" export="currentPageNumber=pageNumber">
				<pg:param name="userid"/>
				<pg:param name="moduleid"/>
				<pg:first>
					<a href="${pageUrl}">首页</a>
				</pg:first>
				<pg:prev>
					<a href="${pageUrl}">前页</a>
				</pg:prev>
				<pg:pages>
					<c:choose>
						<c:when test="${currentPageNumber eq pageNumber}">
							<font color="red">${pageNumber }</font>
						</c:when>
						<c:otherwise>
							<a href="${pageUrl}">${pageNumber }</a>
						</c:otherwise>
					</c:choose>
				</pg:pages>
				<pg:next>
					<a href="${pageUrl}">下页</a>
				</pg:next>
				<pg:last>
					<a href="${pageUrl}">尾页</a>
				</pg:last>
			</pg:pager>
    		</TD>
          </TR>
        </TBODY>
      </TABLE>
  </body>
</html>
